#region Summary

// 
// Owner : JackieHan 
// 
// Solution : Skomart.Spider 
// 
// Project : Jackie.Utility
// 
// File : CodeExistedException.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 编码已经存在异常
// 
// History : 
//			2010-09-26 11:13:46	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;

#endregion

namespace Jackie.Utility.CustomException
{
    /// <summary> 
    /// 编码已经存在异常
    /// </summary>
    public class CodeExistedException : ApplicationException
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="className">对象类名</param>
        /// <param name="codeValue">编码值</param>
        public CodeExistedException(string className, string codeValue)
            : base(string.Format("code[{0}] of object[{1}] has existed!", codeValue, className))
        {
            this.ClassName = className;
            this.CodeValue = codeValue;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="className">对象类名</param>
        /// <param name="codeValue">编码值</param>
        /// <param name="message">自定义消息</param>
        public CodeExistedException(string className,string codeValue,string message)
            :base(message)
        {
            this.ClassName = className;
            this.CodeValue = codeValue;
        }

        /// <summary>
        /// 对象类型
        /// </summary>
        public string ClassName { get; set; }
        /// <summary>
        /// 编码值
        /// </summary>
        public string CodeValue { get; set; }
    }
}